package com.lrs.java.j2se_advanced.beanutils;

import org.apache.commons.beanutils.BeanUtils;

public class NullAwareBeanUtilsTest {

	public static void main(String[] args) throws Exception {
		
		Parent parent = new Parent(1, "p1", 10);
		
		Children child = new Children(2, "c1", 12, 1);
		
//		BeanUtils.copyProperties(child, parent);
		BeanUtils.copyProperties(parent, child);
		
		System.out.println("id : " + child.getId());
		System.out.println("name : " + child.getName());
		System.out.println("age : " + child.getAge());
		System.out.println("parentId : " + child.getParentId());
		
		System.out.println("================================");
		System.out.println("id : " + parent.getId());
		System.out.println("name : " + parent.getName());
		System.out.println("age : " + parent.getAge());
		
	}
	
}
